<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/*
<span class='line'>  2</span>  * $Id: om-combo.js,v 1.175 2012/06/26 08:39:27 linxiaomin Exp $
<span class='line'>  3</span>  * operamasks-ui omCombo @VERSION
<span class='line'>  4</span>  *
<span class='line'>  5</span>  * Copyright 2011, AUTHORS.txt (http://ui.operamasks.org/about)
<span class='line'>  6</span>  * Dual licensed under the MIT or LGPL Version 2 licenses.
<span class='line'>  7</span>  * http://ui.operamasks.org/license
<span class='line'>  8</span>  *
<span class='line'>  9</span>  * http://ui.operamasks.org/docs/
<span class='line'> 10</span>  *
<span class='line'> 11</span>  * Depends:
<span class='line'> 12</span>  *  om-core.js
<span class='line'> 13</span>  */</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="PUNC">;</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='line'> 16</span> </span><span class="WHIT">    </span><span class="COMM">// Array.prototype.indexOf is added in JavaScript v1.6.</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT">    </span><span class="COMM">// IE8 only support JavaScript v1.3. So added it to make this component support IE.</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">Array.prototype.indexOf</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT">        </span><span class="NAME">Array.prototype.indexOf</span><span class="PUNC">=</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">item</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">this.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT">            </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">===</span><span class="NAME">item</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT">                    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 30</span>      * @name omCombo
<span class='line'> 31</span>      * @class 下拉输入框组件。类似于html中的select，但是可以输入，可以过滤，可以使用远程数据。&lt;br/>&lt;br/>
<span class='line'> 32</span>      * &lt;b>特点：&lt;/b>&lt;br/>
<span class='line'> 33</span>      * &lt;ol>
<span class='line'> 34</span>      *      &lt;li>可以使用本地数据源，也可以使用远程数据源&lt;/li>
<span class='line'> 35</span>      *      &lt;li>支持下拉框的缓加载（第一次显示时才初始化下拉框中的内容）&lt;/li>
<span class='line'> 36</span>      *      &lt;li>用户可定制下拉框中数据的显示效果&lt;/li>
<span class='line'> 37</span>      *      &lt;li>用户可定制选择后回填到输入框的文字&lt;/li>
<span class='line'> 38</span>      *      &lt;li>用户可定制选择后组件的value值&lt;/li>
<span class='line'> 39</span>      *      &lt;li>用户可定制下拉框的宽度和最大高度&lt;/li>
<span class='line'> 40</span>      *      &lt;li>具有边输入边过滤的功能，也可定制过滤的算法&lt;/li>
<span class='line'> 41</span>      *      &lt;li>提供丰富的事件&lt;/li>
<span class='line'> 42</span>      * &lt;/ol>
<span class='line'> 43</span>      * 
<span class='line'> 44</span>      * &lt;b>示例：&lt;/b>&lt;br/>
<span class='line'> 45</span>      * &lt;pre>
<span class='line'> 46</span>      * &lt;script type="text/javascript" >
<span class='line'> 47</span>      * $(document).ready(function() {
<span class='line'> 48</span>      *     $('#combo').omCombo({
<span class='line'> 49</span>      *         dataSource:[
<span class='line'> 50</span>      *                 {text:'Java',value:'1'},
<span class='line'> 51</span>      *                 {text:'JavaScript',value:'2'},
<span class='line'> 52</span>      *                 {text:'C',value:'3'},
<span class='line'> 53</span>      *                 {text:'PHP',value:'4'},
<span class='line'> 54</span>      *                 {text:'ASP',value:'5'}
<span class='line'> 55</span>      *         ],
<span class='line'> 56</span>      *         optionField:function(data,index){
<span class='line'> 57</span>      *             return '&lt;font color="red">'+index+'：&lt;/font>'+data.text+'('+data.value+')';
<span class='line'> 58</span>      *         },
<span class='line'> 59</span>      *         emptyText:'select one option!',
<span class='line'> 60</span>      *         value:'1',
<span class='line'> 61</span>      *         editable:false,
<span class='line'> 62</span>      *         lazyLoad:true,
<span class='line'> 63</span>      *         listMaxHeight:40
<span class='line'> 64</span>      *     });
<span class='line'> 65</span>      * });
<span class='line'> 66</span>      * &lt;/script>
<span class='line'> 67</span>      * 
<span class='line'> 68</span>      * &lt;input id="combo"/>
<span class='line'> 69</span>      * &lt;/pre>
<span class='line'> 70</span>      * 
<span class='line'> 71</span>      * @constructor
<span class='line'> 72</span>      * @description 构造函数. 
<span class='line'> 73</span>      * @param p 标准config对象：{}
<span class='line'> 74</span>      */</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT">	</span><span class="NAME">$.omWidget</span><span class="PUNC">(</span><span class="STRN">'om.omCombo'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT">	    </span><span class="NAME">options</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT">	       </span><span class="COMM">/** @lends omCombo#*/</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT">	       </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'> 80</span>                  * 将JSON对象中哪个字段作为option的text，可以指定为JSON的一个属性，也可以指定一个function来自己决定如何显示option的text。&lt;br/>&lt;br/> 
<span class='line'> 81</span>                  * &lt;ul>
<span class='line'> 82</span>                  * &lt;li>对于[{"text":"Java语言","value":"java"},{"text":"C语言","value":"c"},{"text":"C#语言","value":"c#"}]这样的对象,此属性可以不设置，将采用默认值'text'。&lt;/li>
<span class='line'> 83</span>                  * &lt;li>对于[{"label":"Java语言","id":"java"},{"label":"C语言","id":"c"},{"label":"C#语言","id":"c#"}]这样的对象,此属性可以设置为'label'。&lt;/li>
<span class='line'> 84</span>                  * &lt;li>对于[{"name":"深圳","abbreviation":"sz","code":"0755"},{"name":"武汉","abbreviation":"wh","code":"027"},{"name":"北京","abbreviation":"bj","code":"010"}]这样的对象,此属性可以设置为&lt;/li>
<span class='line'> 85</span>                  * &lt;/ul>
<span class='line'> 86</span>                  * &lt;br/>
<span class='line'> 87</span>                  * @type String or Function 
<span class='line'> 88</span>                  * @default 'text' 
<span class='line'> 89</span>                  * @example
<span class='line'> 90</span>                  * optionField:function(data,index){ 
<span class='line'> 91</span>                  *   return data.name+'('+ data.abbreviation+')'; 
<span class='line'> 92</span>                  * }  
<span class='line'> 93</span>                  * // 最后options分显示成"深圳(sz)、武汉(wh)、北京(bj)"这样的。
<span class='line'> 94</span>                  * // 当然也可以写成其它东西，如下面的代码可以实现options为左图片右文字的情况
<span class='line'> 95</span>                  * // return '&lt;img src="options.jpg" style="float:left"/>&lt;span style="float:right">' + data.value+'&lt;/span>'; 
<span class='line'> 96</span>                  */</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT">                </span><span class="NAME">optionField</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'text'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'> 99</span>                  * JSON对象中哪个字段作为option的value属性，可以指定为JSON的一个属性，也可以指定一个function来自己决定如何显示option的value。&lt;br/>&lt;br/>
<span class='line'>100</span>                  * &lt;ul>
<span class='line'>101</span>                  *   &lt;li>[{"text":"Java语言","value":"java"},{"text":"C语言","value":"c"},{"text":"C#语言","value":"c#"}] 将采用默认值'value'。&lt;/li>
<span class='line'>102</span>                  *   &lt;li>[{"label":"Java语言","id":"java"},{"label":"C语言","id":"c"},{"label":"C#语言","id":"c#"}] 此属性可以设置为'id'。&lt;/li>
<span class='line'>103</span>                  *   &lt;li>[{"name":"深圳","abbreviation":"sz","code":"0755"},{"name":"武汉","abbreviation":"wh","code":"027"},{"name":"北京","abbreviation":"bj","code":"010"}]此属性可以设置为'code'&lt;/li>
<span class='line'>104</span>                  * &lt;/ul>
<span class='line'>105</span>                  * &lt;br/>
<span class='line'>106</span>                  * @type String , Function
<span class='line'>107</span>                  * @default 'value'
<span class='line'>108</span>                  * @example
<span class='line'>109</span>                  * 如果JSON数据为
<span class='line'>110</span>                  * [
<span class='line'>111</span>                  *   {"name":"深圳","abbreviation":"sz","code":"0755"},
<span class='line'>112</span>                  *   {"name":"武汉","abbreviation":"wh","code":"027"}
<span class='line'>113</span>                  * ]
<span class='line'>114</span>                  * function(data,index){
<span class='line'>115</span>                  *    return data.code+'(' + data.abbreviation+')';
<span class='line'>116</span>                  * } 
<span class='line'>117</span>                  *  最后各options的值分别是"0755(sz)、027(wh)、010(bj)"这样的。
<span class='line'>118</span>                  *  当然也可以写成其它复杂的东西，如return data.code.substring(1); 
<span class='line'>119</span>                  *  以实现将区号前面的0去掉作为option的value这样的功能。
<span class='line'>120</span>                  */</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT">                </span><span class="NAME">valueField</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'value'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>123</span>                  * 组件宽度。可以使用px、pt、em、auto，如'100px'、'10pt'、'15em'、'auto'
<span class='line'>124</span>                  * @type String
<span class='line'>125</span>                  * @default 'auto'
<span class='line'>126</span>                  * @example
<span class='line'>127</span>                  * width : '100px'
<span class='line'>128</span>                  */</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT">                </span><span class="NAME">width</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'auto'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>131</span>                  * 是否禁用组件。如果禁用，则不可以输入，form提交时也将忽略这个输入框。
<span class='line'>132</span>                  * @type Boolean
<span class='line'>133</span>                  * @default false
<span class='line'>134</span>                  * @example
<span class='line'>135</span>                  * disabled : true
<span class='line'>136</span>                  */</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT">                </span><span class="NAME">disabled</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>139</span>                  * 组件是否只读。如果是只读，则不可以输入，不可以通过下拉框选择一个option，form提交时将包含这个输入框。
<span class='line'>140</span>                  * @type Boolean
<span class='line'>141</span>                  * @default false
<span class='line'>142</span>                  * @example
<span class='line'>143</span>                  * readOnly : true
<span class='line'>144</span>                  */</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT">                </span><span class="NAME">readOnly</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>146</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>147</span>                  * 组件是否可以输入。设成false时不可以输入，但可以从下拉框里选择一个option。
<span class='line'>148</span>                  * @type Boolean
<span class='line'>149</span>                  * @default true
<span class='line'>150</span>                  * @example
<span class='line'>151</span>                  * editable : true
<span class='line'>152</span>                  */</span><span class="WHIT">
<span class='line'>153</span> </span><span class="WHIT">                </span><span class="NAME">editable</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>154</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>155</span>                  * 是否延迟加载下拉框里的选项，设成true时页面显示时不加载下拉框选项，第一次展开下拉框才加载。
<span class='line'>156</span>                  * @type Boolean
<span class='line'>157</span>                  * @default false
<span class='line'>158</span>                  * @example
<span class='line'>159</span>                  * lazyLoad : true
<span class='line'>160</span>                  */</span><span class="WHIT">
<span class='line'>161</span> </span><span class="WHIT">                </span><span class="NAME">lazyLoad</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>162</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>163</span>                  * 组件的下拉框的最大高度，设成'auto'时高度不固定，有多少选项就显示多高；设成50时表示下拉框最大高度50px，如果超过这个则显示垂直滚动条。&lt;b>注意：由于浏览器的限制，这个属性的最小值是31，如果小于这个值时将看不到垂直滚动条&lt;/b>
<span class='line'>164</span>                  * @type Number
<span class='line'>165</span>                  * @default 300
<span class='line'>166</span>                  * @example
<span class='line'>167</span>                  * listMaxHeight : 500
<span class='line'>168</span>                  */</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT">                </span><span class="NAME">listMaxHeight</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">300</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>170</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>171</span>                  * 组件的下拉框的宽度是否自动扩展。设成false时下拉框的宽度将与输入框宽度保持一致；设成true时下拉框宽度将等于最宽的那个选项的宽度。
<span class='line'>172</span>                  * @type Boolean
<span class='line'>173</span>                  * @default false
<span class='line'>174</span>                  * @example
<span class='line'>175</span>                  * listAutoWidth : true
<span class='line'>176</span>                  */</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT">                </span><span class="NAME">listAutoWidth</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>178</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>179</span>                  * 是否自动过滤下拉框选项。设成true时下拉框中将仅显示与输入框当前值匹配（匹配算法由filterStrategy决定）的选项。
<span class='line'>180</span>                  * @type Boolean
<span class='line'>181</span>                  * @default true
<span class='line'>182</span>                  * @example
<span class='line'>183</span>                  * autoFilter : true
<span class='line'>184</span>                  */</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT">                </span><span class="NAME">autoFilter</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>187</span>                  * 自动过滤下拉框选项采用的过滤算法。&lt;b>注意：仅当autoFilter不为false时该属性才有效果&lt;/b>&lt;br/>
<span class='line'>188</span>                  * 默认值为'first'表示从左边匹配（相当于startWith），即下拉框的选项的label以输入框的值开头的才会显示。&lt;br/>
<span class='line'>189</span>                  * 设为'last'表示从右边匹配（相当于endWith），即下拉框的选项的label以输入框的值结尾的才会显示。&lt;br/>
<span class='line'>190</span>                  * 设为'anywhere'表示从任意位置匹配（相当于contains），即下拉框的选项的label只要出现过与输入框的值一样的都会显示。&lt;br/>
<span class='line'>191</span>                  * 也可以设为一个自定义function，该function返回true表示匹配成功，将会显示在下拉列表中，返回true则不显示。
<span class='line'>192</span>                  * @type String,Function
<span class='line'>193</span>                  * @default 'first'
<span class='line'>194</span>                  * @example
<span class='line'>195</span>                  * //此属性可以设置为'first' 或 'last' 或 'anywhere' 或 
<span class='line'>196</span>                  * function(text,record){ 
<span class='line'>197</span>                  *      var reg=new RegExp(text); 
<span class='line'>198</span>                  *      //只要当前记录的postCode属性或idCardNo属性中包含输入框的值就算匹配成功
<span class='line'>199</span>                  *      return reg.test(record.postCode) || reg.test(record.idCradNo); 
<span class='line'>200</span>                  * } 
<span class='line'>201</span>                  */</span><span class="WHIT">
<span class='line'>202</span> </span><span class="WHIT">                </span><span class="NAME">filterStrategy</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'first'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>204</span>                  * 自动过滤下拉框选项延迟时间（单位：毫秒）。如果设成300则表示在300毫秒内输入连续按键多次，则只进行最后一次按键的过滤。&lt;b>注意：仅当autoFilter不为false时该属性才有效果&lt;/b>
<span class='line'>205</span>                  * @type Number
<span class='line'>206</span>                  * @default 500
<span class='line'>207</span>                  * @example
<span class='line'>208</span>                  * filterDelay : 1000
<span class='line'>209</span>                  */</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT">                </span><span class="NAME">filterDelay</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">500</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>211</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>212</span>                  * 是否强制选择。当属性值为true时，强制用户选择下拉列表中的选项，如果用户输入的字符非下拉项中的某项，当输入框失去焦点时，输入框将被清空。
<span class='line'>213</span>                  * 属性值为false时，允许用户输入任意字符，当输入框失去焦点时，该字符串将作为value值。
<span class='line'>214</span>                  * @type Boolean
<span class='line'>215</span>                  * @default false
<span class='line'>216</span>                  * @example
<span class='line'>217</span>                  * forceSelction : false
<span class='line'>218</span>                  */</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT">                </span><span class="NAME">forceSelection</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>220</span> </span><span class="WHIT">                </span><span class="WHIT">
<span class='line'>221</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>222</span>                  * 是否支持多选，默认为 false。如果支持多选默认将不可编辑只可选择。
<span class='line'>223</span>                  * @type Boolean
<span class='line'>224</span>                  * @default false
<span class='line'>225</span>                  * @example
<span class='line'>226</span>                  *  multi : true
<span class='line'>227</span>                  */</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT">                </span><span class="NAME">multi</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT">                </span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>231</span>                  * 支持多选时的多个选项之间的分隔符，默认为 ','.
<span class='line'>232</span>                  * @type String
<span class='line'>233</span>                  * @default ','
<span class='line'>234</span>                  * @example
<span class='line'>235</span>                  *  multiSeparator : ';'
<span class='line'>236</span>                  */</span><span class="WHIT">
<span class='line'>237</span> </span><span class="WHIT">                </span><span class="NAME">multiSeparator</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">','</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT">                </span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>240</span>                  * 数据源属性，可以设置为“后台获取数据的URL”或者“JSON数据”
<span class='line'>241</span>                  * @name omCombo#dataSource
<span class='line'>242</span>                  * @type Array[JSON],URL
<span class='line'>243</span>                  * @default 无
<span class='line'>244</span>                  * @example
<span class='line'>245</span>                  * dataSource : '/operamasks-ui/getCountryNameServlet.json' 
<span class='line'>246</span>                  * 或者
<span class='line'>247</span>                  * dataSource : [{"value":"001","text":"张三"},{"value":"002","text":"李四"}]
<span class='line'>248</span>                  */</span><span class="WHIT">
<span class='line'>249</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>250</span>                  * 当input框的值为空时，input框里出现提示消息。当input框得到焦点或者input框的值不为空时这个提示消息会自动消失。
<span class='line'>251</span>                  * @name omCombo#emptyText
<span class='line'>252</span>                  * @default 无
<span class='line'>253</span>                  * @type String
<span class='line'>254</span>                  * @example
<span class='line'>255</span>                  * emptyText : '请输入值'
<span class='line'>256</span>                  */</span><span class="WHIT">
<span class='line'>257</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>258</span>                  * combo组件的初始值。&lt;b>注意：如果设置了value属性的值则lazyLoad属性将会被强制转换为false&lt;/b>
<span class='line'>259</span>                  * @name omCombo#value
<span class='line'>260</span>                  * @default 无
<span class='line'>261</span>                  * @type String
<span class='line'>262</span>                  * @example
<span class='line'>263</span>                  * value : '北京'
<span class='line'>264</span>                  */</span><span class="WHIT">
<span class='line'>265</span> </span><span class="WHIT">                </span><span class="COMM">/**
<span class='line'>266</span>                  * 填充下拉框内容的function。设置此属性时表示用户要自己接管从records到下拉框的显示过程，用户拿到所有的records然后自己填充下拉框里的内容，最后返回一个JQuery元素集合，集合里的每个元素表示一个option，按上下键选择时将会在这个集合的元素间循环高亮。
<span class='line'>267</span>                  * @name omCombo#listProvider
<span class='line'>268</span>                  * @type Function
<span class='line'>269</span>                  * @default 无
<span class='line'>270</span>                  * @returns {jQuery Array} 应该返回一个jQuery数组，里面的每个元素表示下拉框里的一个option（如下示例中下拉框里是一个table，tabody中的每个tr表示一个option，所以返回container.find('tbody tr')）。
<span class='line'>271</span>                  * @example
<span class='line'>272</span>                  * listProvider:function(container,records){ 
<span class='line'>273</span>                  *      $('&lt;table&gt;').appendTo(container);
<span class='line'>274</span>                  *      records.each(function(){ 
<span class='line'>275</span>                  *          $('&lt;tr&gt;&lt;td&gt;'+this.text+'&lt;td&gt;&lt;/tr&gt;').appendTo(container); 
<span class='line'>276</span>                  *      }); 
<span class='line'>277</span>                  *      $('&lt;/table>').appendTo(container);
<span class='line'>278</span>                  *      return container.find('tbody tr'); //tbody中每个tr表示一个option，而thead中的tr表示表头，不是option
<span class='line'>279</span>                  *  } 
<span class='line'>280</span>                  */</span><span class="WHIT">
<span class='line'>281</span> </span><span class="WHIT">                 </span><span class="COMM">/**
<span class='line'>282</span>                  * 将JSON对象的哪个字段作为显示到input框的文字。可以指定为JSON的一个属性，也可以指定一个function来自己决定显示什么文字到input框。&lt;b>注意：这里的内容在选择一个option后会直接显示在input框里，所以只能显示普通字符串，不能使用html&lt;/b>
<span class='line'>283</span>                  * @name omCombo#inputField
<span class='line'>284</span>                  * @type String or Function
<span class='line'>285</span>                  * @default 'text'
<span class='line'>286</span>                  * @example
<span class='line'>287</span>                  * //以JSON对象的userName属性值作为显示到输入框的文字
<span class='line'>288</span>                  * inputField:'userName'
<span class='line'>289</span>                  * 
<span class='line'>290</span>                  * //自定义一个Function来决定以什么作为显示到输入框的文字
<span class='line'>291</span>                  * inputField:function(data,index){ 
<span class='line'>292</span>                  *      return data.text+'('+data.value+')';
<span class='line'>293</span>                  * } 
<span class='line'>294</span>                  */</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT">                 </span><span class="COMM">/**
<span class='line'>296</span>                  * omCombo的输入框的内容发生变化时的回调函数。
<span class='line'>297</span>                  * @event
<span class='line'>298</span>                  * @param target 当前输入框对象
<span class='line'>299</span>                  * @param newValue 选择的新值
<span class='line'>300</span>                  * @param oldValue 原来的值
<span class='line'>301</span>                  * @param event jQuery.Event对象。
<span class='line'>302</span>                  * @name omCombo#onValueChange
<span class='line'>303</span>                  * @type Function
<span class='line'>304</span>                  * @example
<span class='line'>305</span>                  * onValueChange:function(target,newValue,oldValue,event){ 
<span class='line'>306</span>                  *      //do something
<span class='line'>307</span>                  *  } 
<span class='line'>308</span>                  */</span><span class="WHIT">
<span class='line'>309</span> </span><span class="WHIT">                 </span><span class="COMM">/**
<span class='line'>310</span>                  * 以Ajax方式加载下拉列表中的内容出错时的回调函数。可以在这里进行一些处理，比如以人性化的方式提示用户。
<span class='line'>311</span>                  * @event
<span class='line'>312</span>                  * @param xmlHttpRequest XMLHttpRequest对象
<span class='line'>313</span>                  * @param textStatus  错误类型
<span class='line'>314</span>                  * @param errorThrown  捕获的异常对象
<span class='line'>315</span>                  * @param event jQuery.Event对象。
<span class='line'>316</span>                  * @name omCombo#onError
<span class='line'>317</span>                  * @type Function
<span class='line'>318</span>                  * @example
<span class='line'>319</span>                  * onError:function(xmlHttpRequest, textStatus, errorThrown, event){ 
<span class='line'>320</span>                  *      alert('An error occurred while load records from URL "'+url+'",the error message is:'+errorThrown.message);
<span class='line'>321</span>                  *  } 
<span class='line'>322</span>                  */</span><span class="WHIT">
<span class='line'>323</span> </span><span class="WHIT">                 </span><span class="COMM">/**
<span class='line'>324</span>                  * Ajax响应回来时执行的方法。
<span class='line'>325</span>                  * @event
<span class='line'>326</span>                  * @param data Ajax请求返回的数据
<span class='line'>327</span>                  * @param textStatus 响应的状态
<span class='line'>328</span>                  * @param event jQuery.Event对象。
<span class='line'>329</span>                  * @name omCombo#onSuccess
<span class='line'>330</span>                  * @type Function
<span class='line'>331</span>                  * @example
<span class='line'>332</span>                  * onSuccess:function(data, textStatus, event){
<span class='line'>333</span>                  *     if(data.length==0){
<span class='line'>334</span>                  *          $('#txt').omSuggestion('showMessage','没有数据！');
<span class='line'>335</span>                  *     } 
<span class='line'>336</span>                  * }
<span class='line'>337</span>                  */</span><span class="WHIT">
<span class='line'>338</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>339</span> </span><span class="WHIT">        </span><span class="NAME">_init</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>340</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>341</span> </span><span class="WHIT">                </span><span class="NAME">inputEl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.textInput</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>342</span> </span><span class="WHIT">                </span><span class="NAME">source</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.dataSource</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>343</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>344</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">options.inputField</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>345</span> </span><span class="WHIT">                </span><span class="NAME">options.inputField</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.optionField</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>346</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>347</span> </span><span class="WHIT">            </span><span class="COMM">//由于在lazyLoad=false的情况下设置value时无法显示正确的fieldText</span><span class="WHIT">
<span class='line'>348</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">options.value</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>349</span> </span><span class="WHIT">                </span><span class="NAME">options.lazyLoad</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>350</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>351</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>352</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.width</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'auto'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>353</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">span</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">inputEl.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">width</span><span class="PUNC">(</span><span class="NAME">options.width</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>354</span> </span><span class="WHIT">                </span><span class="NAME">inputEl.width</span><span class="PUNC">(</span><span class="NAME">span.innerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">inputEl.next</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">outerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">inputEl.outerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">inputEl.width</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>355</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>356</span> </span><span class="WHIT">            </span><span class="COMM">/*if (!options.listAutoWidth) {
<span class='line'>357</span>                 this.dropList.width(inputEl.parent().width());
<span class='line'>358</span>             }*/</span><span class="WHIT">
<span class='line'>359</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>360</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.multi</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>361</span> </span><span class="WHIT">                </span><span class="NAME">options.editable</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options.editable</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>362</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>363</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>364</span> </span><span class="WHIT">            </span><span class="NAME">this._refeshEmptyText</span><span class="PUNC">(</span><span class="NAME">options.emptyText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>365</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>366</span> </span><span class="WHIT">            </span><span class="NAME">options.disabled</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">inputEl.attr</span><span class="PUNC">(</span><span class="STRN">'disabled'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">inputEl.removeAttr</span><span class="PUNC">(</span><span class="STRN">'disabled'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>367</span> </span><span class="WHIT">            </span><span class="PUNC">(</span><span class="NAME">options.readOnly</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">options.editable</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">inputEl.attr</span><span class="PUNC">(</span><span class="STRN">'readonly'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'readOnly'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">inputEl.removeAttr</span><span class="PUNC">(</span><span class="STRN">'readonly'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>368</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>369</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">options.lazyLoad</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>370</span> </span><span class="WHIT">                </span><span class="COMM">//load data immediately</span><span class="WHIT">
<span class='line'>371</span> </span><span class="WHIT">                </span><span class="NAME">this._toggleLoading</span><span class="PUNC">(</span><span class="STRN">'add'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>372</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">source</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">source</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>373</span> </span><span class="WHIT">                    </span><span class="NAME">this._ajaxLoad</span><span class="PUNC">(</span><span class="NAME">source</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>374</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">source</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">source</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>375</span> </span><span class="WHIT">                    </span><span class="NAME">this._loadData</span><span class="PUNC">(</span><span class="NAME">source</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>376</span> </span><span class="WHIT">                    </span><span class="NAME">this._toggleLoading</span><span class="PUNC">(</span><span class="STRN">'remove'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>377</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>378</span> </span><span class="WHIT">                    </span><span class="COMM">//neither records nor remote url was found</span><span class="WHIT">
<span class='line'>379</span> </span><span class="WHIT">                    </span><span class="NAME">this.dataHasLoaded</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>380</span> </span><span class="WHIT">                    </span><span class="NAME">this._toggleLoading</span><span class="PUNC">(</span><span class="STRN">'remove'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>381</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>382</span> </span><span class="WHIT">                </span><span class="WHIT">
<span class='line'>383</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>384</span> </span><span class="WHIT">                </span><span class="NAME">this.dataHasLoaded</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>385</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>386</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">unusable</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.disabled</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">options.readOnly</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>387</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>388</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">unusable</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>389</span> </span><span class="WHIT">                </span><span class="NAME">this.expandTrigger.addClass</span><span class="PUNC">(</span><span class="STRN">'om-state-disabled'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>390</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>391</span> </span><span class="WHIT">                </span><span class="NAME">this._bindEvent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>392</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>393</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>394</span> </span><span class="WHIT">        </span><span class="NAME">_create</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>395</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">valueEl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>396</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">span</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;span class="om-combo om-widget om-state-default">&lt;/span>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">insertAfter</span><span class="PUNC">(</span><span class="NAME">valueEl</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">wrapInner</span><span class="PUNC">(</span><span class="NAME">valueEl</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>397</span> </span><span class="WHIT">            </span><span class="NAME">this.textInput</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">valueEl.clone</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeAttr</span><span class="PUNC">(</span><span class="STRN">"id"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeAttr</span><span class="PUNC">(</span><span class="STRN">"name"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendTo</span><span class="PUNC">(</span><span class="NAME">span</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>398</span> </span><span class="WHIT">            </span><span class="NAME">this.expandTrigger</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;span class="om-combo-trigger">&lt;/span>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendTo</span><span class="PUNC">(</span><span class="NAME">span</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>399</span> </span><span class="WHIT">            </span><span class="NAME">valueEl.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>400</span> </span><span class="WHIT">            </span><span class="NAME">this.dropList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'&lt;div class="om-widget">&lt;div class="om-widget-content om-droplist">&lt;/div>&lt;/div>'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">css</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">position</span><span class="PUNC">:</span><span class="STRN">'absolute'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">zIndex</span><span class="PUNC">:</span><span class="NUMB">2000</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendTo</span><span class="PUNC">(</span><span class="NAME">document.body</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">children</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>401</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>402</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>403</span>          * 重新加载下拉框里的数据，一般用于级联combo功能。
<span class='line'>404</span>          * @name omCombo#setData
<span class='line'>405</span>          * @function
<span class='line'>406</span>          * @param arg records（JSON数组）或url
<span class='line'>407</span>          * @example
<span class='line'>408</span>          * //用一个固定的JSON数组来重新加载combo的下拉列表
<span class='line'>409</span>          * $('#productCombo').omCombo('setData',[
<span class='line'>410</span>          *      {"text":'Apusic Server',"value":"aas"},
<span class='line'>411</span>          *      {"text":'Apusic OperaMasks SDK',"value":"aom"},
<span class='line'>412</span>          *      {"text":'Apusic OperaMasks Studio',"value":"studio"}
<span class='line'>413</span>          * ]);
<span class='line'>414</span>          * 
<span class='line'>415</span>          * //通过一个url来发送Ajax请求重新加载combo的下拉列表
<span class='line'>416</span>          * $('#cityCombo').omCombo('setData',"../data/cityData.do?province="+$('#cityCombo').omCombo('value'));
<span class='line'>417</span>          */</span><span class="WHIT">
<span class='line'>418</span> </span><span class="WHIT">        </span><span class="NAME">setData</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">param</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>419</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">inputEl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.textInput</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">valueEl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.element</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>420</span> </span><span class="WHIT">            </span><span class="NAME">self.options.value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>421</span> </span><span class="WHIT">            </span><span class="NAME">valueEl.val</span><span class="PUNC">(</span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>422</span> </span><span class="WHIT">            </span><span class="NAME">inputEl.val</span><span class="PUNC">(</span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>423</span> </span><span class="WHIT">            </span><span class="NAME">self._toggleLoading</span><span class="PUNC">(</span><span class="STRN">'add'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>424</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">param</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>425</span> </span><span class="WHIT">                </span><span class="NAME">self._ajaxLoad</span><span class="PUNC">(</span><span class="NAME">param</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>426</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>427</span> </span><span class="WHIT">                </span><span class="NAME">self._loadData</span><span class="PUNC">(</span><span class="NAME">param</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>428</span> </span><span class="WHIT">                </span><span class="NAME">self._toggleLoading</span><span class="PUNC">(</span><span class="STRN">'remove'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>429</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>430</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>431</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>432</span>          * 获取combo的数据源，返回一个JSON数组。&lt;b>注意：该数组和下拉项数组不是等同的，但存在一一对应的关系:前者经过格式化后能转变成后者&lt;/b>
<span class='line'>433</span>          * @name omCombo#getData
<span class='line'>434</span>          * @function
<span class='line'>435</span>          * @returns 如果combo中有数据，则返回combo的数据源(一个由所有记录组成的JSON数组)；否则返回null
<span class='line'>436</span>          * @example
<span class='line'>437</span>          * //获取combo的数据源
<span class='line'>438</span>          * var store = $('#productCombo').omCombo('getData');
<span class='line'>439</span>          * 
<span class='line'>440</span>          */</span><span class="WHIT">
<span class='line'>441</span> </span><span class="WHIT">        </span><span class="NAME">getData</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>442</span> </span><span class="WHIT">            </span><span class="COMM">//如果已经存在dataSource则直接取出</span><span class="WHIT">
<span class='line'>443</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">returnValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options.dataSource</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>444</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">returnValue</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">returnValue</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>445</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>446</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>447</span>          * 得到或设置combo的value值。
<span class='line'>448</span>          * @function
<span class='line'>449</span>          * @name omCombo#value
<span class='line'>450</span>          * @param v 设置的值，不设置表示获取值
<span class='line'>451</span>          * @returns 如果没有参数时表示getValue()返回combo的value值。如果有参数时表示setValue(newValue)返回jQuery对象。
<span class='line'>452</span>          * 
<span class='line'>453</span>          */</span><span class="WHIT">
<span class='line'>454</span> </span><span class="WHIT">         </span><span class="NAME">value</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>455</span> </span><span class="WHIT">             </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>456</span> </span><span class="WHIT">                 </span><span class="COMM">//var value = $(this.element).attr(_valueKey);</span><span class="WHIT">
<span class='line'>457</span> </span><span class="WHIT">                 </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="NAME">this.element.val</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>458</span> </span><span class="WHIT">            	 </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>459</span> </span><span class="WHIT">             </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>460</span> </span><span class="WHIT">                 </span><span class="NAME">this._setValue</span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">+</span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>461</span> </span><span class="WHIT">                 </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>462</span> </span><span class="WHIT">             </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>463</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>464</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>465</span>          * 禁用组件。
<span class='line'>466</span>          * @name omCombo#disable
<span class='line'>467</span>          * @function
<span class='line'>468</span>          * @example
<span class='line'>469</span>          * $('#mycombo').omCombo('disable');
<span class='line'>470</span>          */</span><span class="WHIT">
<span class='line'>471</span> </span><span class="WHIT">        </span><span class="NAME">disable</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>472</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">input</span><span class="PUNC">=</span><span class="NAME">this.element</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>473</span> </span><span class="WHIT">            </span><span class="COMM">//distroy event listening</span><span class="WHIT">
<span class='line'>474</span> </span><span class="WHIT">            </span><span class="NAME">input.attr</span><span class="PUNC">(</span><span class="STRN">'disabled'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">unbind</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>475</span> </span><span class="WHIT">            </span><span class="NAME">this.options.disabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>476</span> </span><span class="WHIT">            </span><span class="NAME">this.expandTrigger.addClass</span><span class="PUNC">(</span><span class="STRN">'om-state-disabled'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">unbind</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>477</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>478</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>479</span>          * 启用组件。
<span class='line'>480</span>          * @name omCombo#enable
<span class='line'>481</span>          * @function
<span class='line'>482</span>          * @example
<span class='line'>483</span>          * $('#mycombo').omCombo('enable');
<span class='line'>484</span>          */</span><span class="WHIT">
<span class='line'>485</span> </span><span class="WHIT">        </span><span class="NAME">enable</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>486</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">input</span><span class="PUNC">=</span><span class="NAME">this.element</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>487</span> </span><span class="WHIT">            </span><span class="NAME">input.removeAttr</span><span class="PUNC">(</span><span class="STRN">'disabled'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">unbind</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>488</span> </span><span class="WHIT">            </span><span class="NAME">this.options.disabled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>489</span> </span><span class="WHIT">            </span><span class="NAME">this.expandTrigger.removeClass</span><span class="PUNC">(</span><span class="STRN">'om-state-disabled'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">unbind</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>490</span> </span><span class="WHIT">            </span><span class="COMM">//rebuild event listening</span><span class="WHIT">
<span class='line'>491</span> </span><span class="WHIT">            </span><span class="NAME">this._bindEvent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>492</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>493</span> </span><span class="WHIT">        </span><span class="NAME">destroy</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>494</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$input</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>495</span> </span><span class="WHIT">        	</span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">document</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">unbind</span><span class="PUNC">(</span><span class="STRN">'mousedown.omCombo'</span><span class="PUNC">,</span><span class="NAME">this.globalEvent</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>496</span> </span><span class="WHIT">        	</span><span class="NAME">$input.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">after</span><span class="PUNC">(</span><span class="NAME">$input</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>497</span> </span><span class="WHIT">        	</span><span class="NAME">this.dropList.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>498</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>499</span> </span><span class="WHIT">        </span><span class="COMM">//private</span><span class="WHIT">
<span class='line'>500</span> </span><span class="WHIT">        </span><span class="NAME">_bindEvent</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>501</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.options</span><span class="PUNC">,</span><span class="NAME">input</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.textInput</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>502</span> </span><span class="WHIT">            </span><span class="NAME">valueEl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.element</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">dropList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.dropList</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>503</span> </span><span class="WHIT">            </span><span class="NAME">expandTrigger</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.expandTrigger</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">emptyText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.emptyText</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>504</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">isFocus</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">span</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">input.parent</span><span class="PUNC">(</span><span class="STRN">'span'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>505</span> </span><span class="WHIT">            </span><span class="NAME">span.mouseenter</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">   </span><span class="WHIT">
<span class='line'>506</span> </span><span class="WHIT">               </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">options.disabled</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>507</span> </span><span class="WHIT">                   </span><span class="NAME">span.addClass</span><span class="PUNC">(</span><span class="STRN">"om-state-hover"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>508</span> </span><span class="WHIT">               </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>509</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">mouseleave</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">      </span><span class="WHIT">
<span class='line'>510</span> </span><span class="WHIT">                </span><span class="NAME">span.removeClass</span><span class="PUNC">(</span><span class="STRN">"om-state-hover"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>511</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">mousedown</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>512</span> </span><span class="WHIT">                </span><span class="NAME">e.stopPropagation</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//document的mousedown会隐藏下拉框，这里要阻止冒泡</span><span class="WHIT">
<span class='line'>513</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>514</span> </span><span class="WHIT">            </span><span class="NAME">input.focus</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>515</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">isFocus</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>516</span> </span><span class="WHIT">                    </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>517</span> </span><span class="WHIT">                </span><span class="NAME">isFocus</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>518</span> </span><span class="WHIT">                </span><span class="NAME">$</span><span class="PUNC">(</span><span class="STRN">'.om-droplist'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//hide all other dropLists</span><span class="WHIT">
<span class='line'>519</span> </span><span class="WHIT">                </span><span class="NAME">span.addClass</span><span class="PUNC">(</span><span class="STRN">'om-state-focus'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>520</span> </span><span class="WHIT">                </span><span class="COMM">//input.addClass('om-span-field-focus');</span><span class="WHIT">
<span class='line'>521</span> </span><span class="WHIT">                </span><span class="COMM">//input.parent('span').</span><span class="WHIT">
<span class='line'>522</span> </span><span class="WHIT">                </span><span class="COMM">//expandTrigger.addClass('om-state-hover');</span><span class="WHIT">
<span class='line'>523</span> </span><span class="WHIT">                </span><span class="NAME">self._refeshEmptyText</span><span class="PUNC">(</span><span class="NAME">emptyText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>524</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">self.dataHasLoaded</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>525</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">expandTrigger.hasClass</span><span class="PUNC">(</span><span class="STRN">'om-loading'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>526</span> </span><span class="WHIT">                        </span><span class="NAME">self._toggleLoading</span><span class="PUNC">(</span><span class="STRN">'add'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>527</span> </span><span class="WHIT">                        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">options.dataSource</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>528</span> </span><span class="WHIT">                            </span><span class="NAME">self._loadData</span><span class="PUNC">(</span><span class="NAME">options.dataSource</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>529</span> </span><span class="WHIT">                            </span><span class="NAME">self._toggleLoading</span><span class="PUNC">(</span><span class="STRN">'remove'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>530</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">options.dataSource</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>531</span> </span><span class="WHIT">                            </span><span class="NAME">self._ajaxLoad</span><span class="PUNC">(</span><span class="NAME">options.dataSource</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>532</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>533</span> </span><span class="WHIT">                            </span><span class="COMM">//neither records nor remote url was found</span><span class="WHIT">
<span class='line'>534</span> </span><span class="WHIT">                            </span><span class="NAME">self.dataHasLoaded</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>535</span> </span><span class="WHIT">                            </span><span class="NAME">self._toggleLoading</span><span class="PUNC">(</span><span class="STRN">'remove'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>536</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>537</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>538</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>539</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">options.disabled</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">options.readOnly</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>540</span> </span><span class="WHIT">                    </span><span class="NAME">self._showDropList</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>541</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>542</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">blur</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>543</span> </span><span class="WHIT">                </span><span class="NAME">isFocus</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>544</span> </span><span class="WHIT">                </span><span class="NAME">span.removeClass</span><span class="PUNC">(</span><span class="STRN">'om-state-focus'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>545</span> </span><span class="WHIT">                </span><span class="NAME">input.removeClass</span><span class="PUNC">(</span><span class="STRN">'om-combo-focus'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>546</span> </span><span class="WHIT">                </span><span class="COMM">//expandTrigger.removeClass('om-trigger-hover');</span><span class="WHIT">
<span class='line'>547</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">options.disabled</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">options.readOnly</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">options.multi</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>548</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self.hasManualInput</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>549</span> </span><span class="WHIT">                        </span><span class="COMM">//如果有手工输入过值，在blur时检查是否是合法的值，如果不是要清除不合法的输入并还原成输入前的值</span><span class="WHIT">
<span class='line'>550</span> </span><span class="WHIT">                        </span><span class="NAME">self.hasManualInput</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>551</span> </span><span class="WHIT">                        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">text</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">input.val</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>552</span> </span><span class="WHIT">                        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">text</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>553</span> </span><span class="WHIT">                            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">allInputText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$.data</span><span class="PUNC">(</span><span class="NAME">valueEl</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'allInputText'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>554</span> </span><span class="WHIT">                            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">allValues</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$.data</span><span class="PUNC">(</span><span class="NAME">valueEl</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'allValues'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>555</span> </span><span class="WHIT">                            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">allInputText.indexOf</span><span class="PUNC">(</span><span class="NAME">text</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>556</span> </span><span class="WHIT">                            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>557</span> </span><span class="WHIT">                                </span><span class="NAME">self._setValue</span><span class="PUNC">(</span><span class="NAME">allValues</span><span class="PUNC">[</span><span class="NAME">index</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>558</span> </span><span class="WHIT">                            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">options.forceSelection</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//如果输入的值在data里面不存在，则设置key和vlue为同一输入的值</span><span class="WHIT">
<span class='line'>559</span> </span><span class="WHIT">                                </span><span class="NAME">valueEl.val</span><span class="PUNC">(</span><span class="NAME">input.val</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>560</span> </span><span class="WHIT">                            </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>561</span> </span><span class="WHIT">                            	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">valueEl.val</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>562</span> </span><span class="WHIT">                                </span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">allValues.indexOf</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>563</span> </span><span class="WHIT">                                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>564</span> </span><span class="WHIT">                                    </span><span class="NAME">input.val</span><span class="PUNC">(</span><span class="NAME">allInputText</span><span class="PUNC">[</span><span class="NAME">index</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>565</span> </span><span class="WHIT">                                </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>566</span> </span><span class="WHIT">                                    </span><span class="NAME">input.val</span><span class="PUNC">(</span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>567</span> </span><span class="WHIT">                                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>568</span> </span><span class="WHIT">                            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>569</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>570</span> </span><span class="WHIT">                        	</span><span class="NAME">valueEl.val</span><span class="PUNC">(</span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>571</span> </span><span class="WHIT">                    	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>572</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>573</span> </span><span class="WHIT">                    </span><span class="NAME">self._refeshEmptyText</span><span class="PUNC">(</span><span class="NAME">emptyText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>574</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>575</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">keyup</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>576</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">key</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.keyCode</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>577</span> </span><span class="WHIT">                    </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$.om.keyCode</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>578</span> </span><span class="WHIT">                </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>579</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">value.DOWN</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>580</span> </span><span class="WHIT">                        </span><span class="NAME">self._selectNext</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>581</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>582</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">value.UP</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>583</span> </span><span class="WHIT">                        </span><span class="NAME">self._selectPrev</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>584</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>585</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">value.ENTER</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>586</span> </span><span class="WHIT">                        </span><span class="NAME">self._backfill</span><span class="PUNC">(</span><span class="NAME">self.dropList.find</span><span class="PUNC">(</span><span class="STRN">'.om-state-hover'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>587</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>588</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">value.ESCAPE</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>589</span> </span><span class="WHIT">                        </span><span class="NAME">dropList.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>590</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>591</span> </span><span class="WHIT">                    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">value.TAB</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>592</span> </span><span class="WHIT">                        </span><span class="COMM">//only trigger the blur event</span><span class="WHIT">
<span class='line'>593</span> </span><span class="WHIT">                        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>594</span> </span><span class="WHIT">                    </span><span class="KEYW">default</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>595</span> </span><span class="WHIT">                        </span><span class="COMM">//fiter功能</span><span class="WHIT">
<span class='line'>596</span> </span><span class="WHIT">                        </span><span class="NAME">self.hasManualInput</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>597</span> </span><span class="WHIT">                        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">options.disabled</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">options.readOnly</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">options.editable</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">options.autoFilter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>598</span> </span><span class="WHIT">                            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window._omcomboFilterTimer</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>599</span> </span><span class="WHIT">                                </span><span class="NAME">clearTimeout</span><span class="PUNC">(</span><span class="NAME">window._omcomboFilterTimer</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>600</span> </span><span class="WHIT">                            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>601</span> </span><span class="WHIT">                            </span><span class="NAME">window._omcomboFilterTimer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">setTimeout</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>602</span> </span><span class="WHIT">                                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">document</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">'activeElement'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">input.attr</span><span class="PUNC">(</span><span class="STRN">'id'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="COMM">//当焦点在当前输入框的时候才显示下拉框，否则隐藏</span><span class="WHIT">
<span class='line'>603</span> </span><span class="WHIT">                                    </span><span class="NAME">dropList.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>604</span> </span><span class="WHIT">                                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>605</span> </span><span class="WHIT">                                </span><span class="NAME">self._doFilter</span><span class="PUNC">(</span><span class="NAME">input</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>606</span> </span><span class="WHIT">                            </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options.filterDelay</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>607</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>608</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>609</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>610</span> </span><span class="WHIT">            </span><span class="NAME">dropList.mousedown</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>611</span> </span><span class="WHIT">                </span><span class="NAME">e.stopPropagation</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//document的mousedown会隐藏下拉框，这里要阻止冒泡</span><span class="WHIT">
<span class='line'>612</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>613</span> </span><span class="WHIT">            </span><span class="NAME">expandTrigger.click</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>614</span> </span><span class="WHIT">                </span><span class="PUNC">!</span><span class="NAME">expandTrigger.hasClass</span><span class="PUNC">(</span><span class="STRN">'om-loading'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">input.focus</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>615</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">mousedown</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>616</span> </span><span class="WHIT">                </span><span class="PUNC">!</span><span class="NAME">expandTrigger.hasClass</span><span class="PUNC">(</span><span class="STRN">'om-loading'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">span.addClass</span><span class="PUNC">(</span><span class="STRN">'om-state-active'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>617</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">mouseup</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>618</span> </span><span class="WHIT">                </span><span class="PUNC">!</span><span class="NAME">expandTrigger.hasClass</span><span class="PUNC">(</span><span class="STRN">'om-loading'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">span.removeClass</span><span class="PUNC">(</span><span class="STRN">'om-state-active'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>619</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>620</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">document</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">bind</span><span class="PUNC">(</span><span class="STRN">'mousedown.omCombo'</span><span class="PUNC">,</span><span class="NAME">this.globalEvent</span><span class="PUNC">=</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>621</span> </span><span class="WHIT">                </span><span class="NAME">dropList.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>622</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>623</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>624</span> </span><span class="WHIT">        </span><span class="NAME">_showDropList</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>625</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.options</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>626</span> </span><span class="WHIT">        	    </span><span class="NAME">inputEl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.textInput</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">valueInput</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>627</span> </span><span class="WHIT">          	    </span><span class="NAME">dropList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.dropList.scrollTop</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">css</span><span class="PUNC">(</span><span class="STRN">'height'</span><span class="PUNC">,</span><span class="STRN">'auto'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>628</span> </span><span class="WHIT">         	    </span><span class="NAME">valuedItem</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>629</span> </span><span class="WHIT">         	    </span><span class="NAME">nowValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">valueInput.val</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>630</span> </span><span class="WHIT">         	    </span><span class="NAME">$listRows</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dropList.find</span><span class="PUNC">(</span><span class="STRN">'.om-combo-list-row'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>631</span> </span><span class="WHIT">         	    </span><span class="NAME">allItems</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._getAllOptionsBeforeFiltered</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">'om-helper-hidden om-state-hover'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>632</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>633</span> </span><span class="WHIT">        	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">allItems.size</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">&lt;=</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//如果下拉框没有数据</span><span class="WHIT">
<span class='line'>634</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>635</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>636</span> </span><span class="WHIT">            </span><span class="NAME">$listRows.removeClass</span><span class="PUNC">(</span><span class="STRN">'om-combo-selected'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>637</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowValue</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">nowValue</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>638</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">allValues</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$.data</span><span class="PUNC">(</span><span class="NAME">valueInput</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'allValues'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>639</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.multi</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>640</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">selectedValues</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nowValue.split</span><span class="PUNC">(</span><span class="NAME">options.multiSeparator</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>641</span> </span><span class="WHIT">                    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">selectedValues.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>642</span> </span><span class="WHIT">                        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">allValues.indexOf</span><span class="PUNC">(</span><span class="NAME">selectedValues</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>643</span> </span><span class="WHIT">                        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>644</span> </span><span class="WHIT">                            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">dropList.find</span><span class="PUNC">(</span><span class="STRN">'.om-combo-list-row'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">get</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'om-combo-selected'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>645</span> </span><span class="WHIT">                        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>646</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>647</span> </span><span class="WHIT">                    </span><span class="NAME">valueItem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">selectedValues</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>648</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>649</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">allValues</span><span class="PUNC">?</span><span class="NAME">allValues.indexOf</span><span class="PUNC">(</span><span class="NAME">nowValue</span><span class="PUNC">)</span><span class="PUNC">:</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>650</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>651</span> </span><span class="WHIT">                        </span><span class="NAME">valuedItem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">dropList.find</span><span class="PUNC">(</span><span class="STRN">'.om-combo-list-row'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">get</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'om-combo-selected'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>652</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>653</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>654</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>655</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dropListContainer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dropList.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">span</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">inputEl.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>656</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">options.listAutoWidth</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>657</span> </span><span class="WHIT">                </span><span class="NAME">dropListContainer.width</span><span class="PUNC">(</span><span class="NAME">span.outerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>658</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>659</span> </span><span class="WHIT">            	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$.browser.msie</span><span class="PUNC">&&</span><span class="PUNC">(</span><span class="NAME">$.browser.version</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"7.0"</span><span class="PUNC">)</span><span class="PUNC">&&</span><span class="PUNC">!</span><span class="NAME">$.support.style</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>660</span> </span><span class="WHIT">            		</span><span class="NAME">dropListContainer.width</span><span class="PUNC">(</span><span class="NAME">dropList.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">outerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>661</span> </span><span class="WHIT">            	</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>662</span> </span><span class="WHIT">            		</span><span class="NAME">dropListContainer.width</span><span class="PUNC">(</span><span class="NAME">dropList.outerWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>663</span> </span><span class="WHIT">            	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>664</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>665</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.listMaxHeight</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'auto'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">dropList.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">height</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">options.listMaxHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>666</span> </span><span class="WHIT">                </span><span class="NAME">dropList.height</span><span class="PUNC">(</span><span class="NAME">options.listMaxHeight</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">css</span><span class="PUNC">(</span><span class="STRN">'overflow-y'</span><span class="PUNC">,</span><span class="STRN">'auto'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>667</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>668</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">inputPos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">span.offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>669</span> </span><span class="WHIT">            </span><span class="NAME">dropListContainer.css</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>670</span> </span><span class="WHIT">                </span><span class="STRN">'left'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">inputPos.left</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>671</span> </span><span class="WHIT">                </span><span class="STRN">'top'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">inputPos.top</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">span.outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>672</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>673</span> </span><span class="WHIT">            </span><span class="NAME">dropList.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>674</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">valuedItem</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//自动滚动滚动条到高亮的行</span><span class="WHIT">
<span class='line'>675</span> </span><span class="WHIT">                </span><span class="NAME">dropList.scrollTop</span><span class="PUNC">(</span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">valuedItem</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">dropList.offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>676</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>677</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>678</span> </span><span class="WHIT">        </span><span class="NAME">_toggleLoading</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>679</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.options.disabled</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>680</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'add'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>681</span> </span><span class="WHIT">                    </span><span class="NAME">this.expandTrigger.removeClass</span><span class="PUNC">(</span><span class="STRN">'om-icon-carat-1-s'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'om-loading'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>682</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'remove'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>683</span> </span><span class="WHIT">                    </span><span class="NAME">this.expandTrigger.removeClass</span><span class="PUNC">(</span><span class="STRN">'om-loading'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'om-icon-carat-1-s'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>684</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>685</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>686</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>687</span> </span><span class="WHIT">        </span><span class="NAME">_ajaxLoad</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">url</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>688</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">=</span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>689</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>690</span> </span><span class="WHIT">            </span><span class="NAME">$.ajax</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>691</span> </span><span class="WHIT">                </span><span class="NAME">url</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">url</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>692</span> </span><span class="WHIT">                </span><span class="NAME">method</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'POST'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>693</span> </span><span class="WHIT">                </span><span class="NAME">dataType</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'json'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>694</span> </span><span class="WHIT">                </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">textStatus</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>695</span> </span><span class="WHIT">                    </span><span class="NAME">self.dataHasLoaded</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>696</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">onSuccess</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.onSuccess</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>697</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">onSuccess</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">self._trigger</span><span class="PUNC">(</span><span class="STRN">"onSuccess"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">textStatus</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>698</span> </span><span class="WHIT">                        </span><span class="NAME">options.dataSource</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>699</span> </span><span class="WHIT">                        </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>700</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>701</span> </span><span class="WHIT">                    </span><span class="NAME">self._loadData</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>702</span> </span><span class="WHIT">                    </span><span class="NAME">self._toggleLoading</span><span class="PUNC">(</span><span class="STRN">'remove'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>703</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>704</span> </span><span class="WHIT">                </span><span class="NAME">error</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">XMLHttpRequest</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">textStatus</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">errorThrown</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>705</span> </span><span class="WHIT">                    </span><span class="NAME">self.dataHasLoaded</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// 必须设置为true，否则在lazyLoad为true的时候会陷入死循环</span><span class="WHIT">
<span class='line'>706</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.onError</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>707</span> </span><span class="WHIT">                        </span><span class="NAME">self._toggleLoading</span><span class="PUNC">(</span><span class="STRN">'remove'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>708</span> </span><span class="WHIT">                        </span><span class="NAME">self._trigger</span><span class="PUNC">(</span><span class="STRN">"onError"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">XMLHttpRequest</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">textStatus</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">errorThrown</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>709</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>710</span> </span><span class="WHIT">                        </span><span class="NAME">self._toggleLoading</span><span class="PUNC">(</span><span class="STRN">'remove'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>711</span> </span><span class="WHIT">                        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'An error occurred while load records from URL "'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'",the error message is:'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">errorThrown.message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>712</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>713</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>714</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>715</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>716</span> </span><span class="WHIT">        </span><span class="NAME">_loadData</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">records</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>717</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>718</span> </span><span class="WHIT">                </span><span class="NAME">valueEl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>719</span> </span><span class="WHIT">            </span><span class="NAME">options.dataSource</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">records</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>720</span> </span><span class="WHIT">            </span><span class="NAME">this.dataHasLoaded</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>721</span> </span><span class="WHIT">            </span><span class="COMM">//build all inputText</span><span class="WHIT">
<span class='line'>722</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">inputField</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.inputField</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>723</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">allInputText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>724</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">inputField</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>725</span> </span><span class="WHIT">                </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">records</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>726</span> </span><span class="WHIT">                    </span><span class="NAME">allInputText.push</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">[</span><span class="NAME">inputField</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>727</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>728</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>729</span> </span><span class="WHIT">                </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">records</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>730</span> </span><span class="WHIT">                    </span><span class="NAME">allInputText.push</span><span class="PUNC">(</span><span class="NAME">inputField</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>731</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>732</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>733</span> </span><span class="WHIT">            </span><span class="NAME">$.data</span><span class="PUNC">(</span><span class="NAME">valueEl</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'allInputText'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">allInputText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>734</span> </span><span class="WHIT">            </span><span class="COMM">//build all value</span><span class="WHIT">
<span class='line'>735</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">valueField</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.valueField</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>736</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">allValues</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>737</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">valueField</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>738</span> </span><span class="WHIT">                </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">records</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>739</span> </span><span class="WHIT">                    </span><span class="NAME">allValues.push</span><span class="PUNC">(</span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">[</span><span class="NAME">valueField</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>740</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>741</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>742</span> </span><span class="WHIT">                </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">records</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>743</span> </span><span class="WHIT">                    </span><span class="NAME">allValues.push</span><span class="PUNC">(</span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">valueField</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>744</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>745</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>746</span> </span><span class="WHIT">            </span><span class="NAME">$.data</span><span class="PUNC">(</span><span class="NAME">valueEl</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'allValues'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">allValues</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>747</span> </span><span class="WHIT">            </span><span class="COMM">//build dropList</span><span class="WHIT">
<span class='line'>748</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dropList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.dropList.empty</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>749</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.listProvider</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>750</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">selectableOptions</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.listProvider</span><span class="PUNC">(</span><span class="NAME">dropList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">records</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>751</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">selectableOptions</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>752</span> </span><span class="WHIT">                    </span><span class="NAME">selectableOptions.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>753</span> </span><span class="WHIT">                        </span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'om-combo-list-row'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>754</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>755</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>756</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>757</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">optionField</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.optionField</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>758</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">innerHtml</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>759</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>760</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">optionField</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>761</span> </span><span class="WHIT">                    </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">records</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>762</span> </span><span class="WHIT">                        </span><span class="NAME">innerHtml</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._wrapText</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">[</span><span class="NAME">options.optionField</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>763</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>764</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>765</span> </span><span class="WHIT">                    </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">records</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>766</span> </span><span class="WHIT">                        </span><span class="NAME">innerHtml</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._wrapText</span><span class="PUNC">(</span><span class="NAME">options.optionField</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>767</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>768</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>769</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">innerHtml</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>770</span> </span><span class="WHIT">                    </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">innerHtml</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendTo</span><span class="PUNC">(</span><span class="NAME">dropList</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>771</span> </span><span class="WHIT">                    </span><span class="NAME">dropList.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">css</span><span class="PUNC">(</span><span class="STRN">'height'</span><span class="PUNC">,</span><span class="STRN">'auto'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>772</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.listMaxHeight</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'auto'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">dropList.height</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">options.listMaxHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>773</span> </span><span class="WHIT">                        </span><span class="NAME">dropList.height</span><span class="PUNC">(</span><span class="NAME">options.listMaxHeight</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">css</span><span class="PUNC">(</span><span class="STRN">'overflow-y'</span><span class="PUNC">,</span><span class="STRN">'auto'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>774</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>775</span> </span><span class="WHIT">                    </span><span class="NAME">dropList.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>776</span> </span><span class="WHIT">                    </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">valueEl.parent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">hasClass</span><span class="PUNC">(</span><span class="STRN">'om-state-hover'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>777</span> </span><span class="WHIT">                        </span><span class="NAME">self._showDropList</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>778</span> </span><span class="WHIT">                    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>779</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>780</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>781</span> </span><span class="WHIT">           </span><span class="WHIT">
<span class='line'>782</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>783</span> </span><span class="WHIT">                </span><span class="NAME">this._setValue</span><span class="PUNC">(</span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">options.value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>784</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>785</span> </span><span class="WHIT">            </span><span class="NAME">this._bindEventsToList</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>786</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>787</span> </span><span class="WHIT">        </span><span class="NAME">_bindEventsToList</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>788</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>789</span> </span><span class="WHIT">        	</span><span class="NAME">items</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._getAllOptionsBeforeFiltered</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>790</span> </span><span class="WHIT">            </span><span class="NAME">items.hover</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>791</span> </span><span class="WHIT">                </span><span class="NAME">items.removeClass</span><span class="PUNC">(</span><span class="STRN">'om-state-hover'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>792</span> </span><span class="WHIT">                </span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'om-state-hover'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>793</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>794</span> </span><span class="WHIT">                </span><span class="NAME">$</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">'om-state-hover'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>795</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">mousedown</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>796</span> </span><span class="WHIT">                </span><span class="NAME">self._backfill</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>797</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>798</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>799</span> </span><span class="WHIT">        </span><span class="NAME">_wrapText</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">text</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>800</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'&lt;div class="om-combo-list-row">'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">text</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'&lt;/div>'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>801</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>802</span> </span><span class="WHIT">        </span><span class="NAME">_setValue</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>803</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">input</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.textInput</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">valueEl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.element</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>804</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">valueChange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>805</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">valueEl.val</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>806</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>807</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>808</span> </span><span class="WHIT">                </span><span class="NAME">valueChange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>809</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>810</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">allValues</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$.data</span><span class="PUNC">(</span><span class="NAME">valueEl</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'allValues'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>811</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>812</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">inputText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">values</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>813</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.multi</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>814</span> </span><span class="WHIT">                </span><span class="NAME">values</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value.split</span><span class="PUNC">(</span><span class="NAME">options.multiSeparator</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>815</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>816</span> </span><span class="WHIT">                </span><span class="NAME">values.push</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>817</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>818</span> </span><span class="WHIT">            </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">values.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>819</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">allValues</span><span class="PUNC">?</span><span class="NAME">allValues.indexOf</span><span class="PUNC">(</span><span class="NAME">values</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">:</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>820</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>821</span> </span><span class="WHIT">                    </span><span class="NAME">inputText.push</span><span class="PUNC">(</span><span class="NAME">$.data</span><span class="PUNC">(</span><span class="NAME">valueEl</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'allInputText'</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">index</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>822</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">options.forceSelection</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>823</span> </span><span class="WHIT">                	</span><span class="COMM">//与getValue保持一致，当setValue的值不在allVlues中，则将value值作为text显示在输入框中。bug616。</span><span class="WHIT">
<span class='line'>824</span> </span><span class="WHIT">                	</span><span class="NAME">inputText.push</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>825</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>826</span> </span><span class="WHIT">                	</span><span class="NAME">valueEl.val</span><span class="PUNC">(</span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>827</span> </span><span class="WHIT">                    </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>828</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>829</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>830</span> </span><span class="WHIT">            </span><span class="NAME">valueEl.val</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>831</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.multi</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>832</span> </span><span class="WHIT">                </span><span class="NAME">input.val</span><span class="PUNC">(</span><span class="NAME">inputText.join</span><span class="PUNC">(</span><span class="NAME">options.multiSeparator</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>833</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>834</span> </span><span class="WHIT">                </span><span class="NAME">input.val</span><span class="PUNC">(</span><span class="NAME">inputText.join</span><span class="PUNC">(</span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>835</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>836</span> </span><span class="WHIT">            </span><span class="NAME">options.value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>837</span> </span><span class="WHIT">            </span><span class="COMM">// trigger onValueChange event</span><span class="WHIT">
<span class='line'>838</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.onValueChange</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">valueChange</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>839</span> </span><span class="WHIT">            	</span><span class="NAME">this._trigger</span><span class="PUNC">(</span><span class="STRN">"onValueChange"</span><span class="PUNC">,</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="NAME">input</span><span class="PUNC">,</span><span class="NAME">value</span><span class="PUNC">,</span><span class="NAME">oldValue</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>840</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>841</span> </span><span class="WHIT">            </span><span class="COMM">//refresh the emptyText</span><span class="WHIT">
<span class='line'>842</span> </span><span class="WHIT">            </span><span class="NAME">this._refeshEmptyText</span><span class="PUNC">(</span><span class="NAME">options.emptyText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>843</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>844</span> </span><span class="WHIT">        </span><span class="WHIT">
<span class='line'>845</span> </span><span class="WHIT">        </span><span class="NAME">_findHighlightItem</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>846</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dropList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.dropList</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>847</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hoverItem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dropList.find</span><span class="PUNC">(</span><span class="STRN">'.om-state-hover'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>848</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>849</span> </span><span class="WHIT">            </span><span class="COMM">// only one item hover</span><span class="WHIT">
<span class='line'>850</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hoverItem.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>851</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">hoverItem</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>852</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>853</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">selectedItems</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dropList.find</span><span class="PUNC">(</span><span class="STRN">'.om-combo-selected'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>854</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">selectedItems.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">selectedItems</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">selectedItems</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>855</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>856</span> </span><span class="WHIT">        </span><span class="WHIT">
<span class='line'>857</span> </span><span class="WHIT">        </span><span class="NAME">_selectPrev</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>858</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">highLightItem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._findHighlightItem</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>859</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">all</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._getAllOptionsAfterFiltered</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>860</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nowIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">all.index</span><span class="PUNC">(</span><span class="NAME">highLightItem</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>861</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">currentItem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">all</span><span class="PUNC">[</span><span class="NAME">nowIndex</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>862</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowIndex</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>863</span> </span><span class="WHIT">                </span><span class="NAME">nowIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">all.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>864</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowIndex</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>865</span> </span><span class="WHIT">                </span><span class="NAME">nowIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">all.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>866</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>867</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">preNeighborItem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">all</span><span class="PUNC">[</span><span class="NAME">nowIndex</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>868</span> </span><span class="WHIT">            </span><span class="NAME">this._highLisghtAndScrollTo</span><span class="PUNC">(</span><span class="NAME">currentItem</span><span class="PUNC">,</span><span class="NAME">preNeighborItem</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>869</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>870</span> </span><span class="WHIT">        </span><span class="NAME">_selectNext</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>871</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dropList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.dropList</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>872</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dropList.css</span><span class="PUNC">(</span><span class="STRN">'display'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'none'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>873</span> </span><span class="WHIT">                </span><span class="NAME">this._showDropList</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>874</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>875</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>876</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">all</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this._getAllOptionsAfterFiltered</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>877</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nowIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">all.index</span><span class="PUNC">(</span><span class="NAME">this._findHighlightItem</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>878</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">currentItem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">all</span><span class="PUNC">[</span><span class="NAME">nowIndex</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>879</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowIndex</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">all.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>880</span> </span><span class="WHIT">                </span><span class="NAME">nowIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>881</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>882</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nextNeighbor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">all</span><span class="PUNC">[</span><span class="NAME">nowIndex</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>883</span> </span><span class="WHIT">            </span><span class="NAME">this._highLisghtAndScrollTo</span><span class="PUNC">(</span><span class="NAME">currentItem</span><span class="PUNC">,</span><span class="NAME">nextNeighbor</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>884</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>885</span> </span><span class="WHIT">        </span><span class="NAME">_highLisghtAndScrollTo</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">currentItem</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">targetItem</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>886</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dropList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.dropList</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>887</span> </span><span class="WHIT">            </span><span class="NAME">currentItem.removeClass</span><span class="PUNC">(</span><span class="STRN">'om-state-hover'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>888</span> </span><span class="WHIT">            </span><span class="NAME">targetItem.addClass</span><span class="PUNC">(</span><span class="STRN">'om-state-hover'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>889</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">targetItem.position</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>890</span> </span><span class="WHIT">                </span><span class="NAME">dropList.scrollTop</span><span class="PUNC">(</span><span class="NAME">dropList.scrollTop</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">targetItem.position</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>891</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">targetItem.position</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">targetItem.outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">dropList.height</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>892</span> </span><span class="WHIT">                </span><span class="NAME">dropList.scrollTop</span><span class="PUNC">(</span><span class="NAME">dropList.scrollTop</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">targetItem.position</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">top</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">targetItem.outerHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">dropList.height</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>893</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>894</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>895</span> </span><span class="WHIT">        </span><span class="NAME">_backfill</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">source</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>896</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">source.length</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>897</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>898</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>899</span> </span><span class="WHIT">                </span><span class="WHIT">
<span class='line'>900</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">valueEl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>901</span> </span><span class="WHIT">            </span><span class="NAME">dropList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.dropList</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>902</span> </span><span class="WHIT">            </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>903</span> </span><span class="WHIT">            </span><span class="NAME">enableMulti</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.multi</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>904</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>905</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">enableMulti</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>906</span> </span><span class="WHIT">                </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">source</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toggleClass</span><span class="PUNC">(</span><span class="STRN">'om-combo-selected'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">'om-state-hover'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>907</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>908</span> </span><span class="WHIT">                </span><span class="NAME">this._getAllOptionsBeforeFiltered</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">'om-combo-selected'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>909</span> </span><span class="WHIT">                </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">source</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'om-combo-selected'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>910</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>911</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>912</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dropList.css</span><span class="PUNC">(</span><span class="STRN">'display'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'none'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>913</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>914</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>915</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">selectedIndexs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dropList.find</span><span class="PUNC">(</span><span class="STRN">'.om-combo-selected'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>916</span> </span><span class="WHIT">            </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">selectedIndexs.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>917</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nowIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">selectedIndexs</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">index</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>918</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nowIndex</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>919</span> </span><span class="WHIT">                    </span><span class="NAME">value.push</span><span class="PUNC">(</span><span class="NAME">$.data</span><span class="PUNC">(</span><span class="NAME">valueEl</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'allValues'</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">nowIndex</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>920</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>921</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>922</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>923</span> </span><span class="WHIT">            </span><span class="NAME">this._setValue</span><span class="PUNC">(</span><span class="NAME">value.join</span><span class="PUNC">(</span><span class="NAME">enableMulti</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">options.multiSeparator</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>924</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">enableMulti</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>925</span> </span><span class="WHIT">                </span><span class="NAME">dropList.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>926</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>927</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>928</span> </span><span class="WHIT">        </span><span class="NAME">_getAllOptionsBeforeFiltered</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>929</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.dropList.find</span><span class="PUNC">(</span><span class="STRN">'.om-combo-list-row'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>930</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>931</span> </span><span class="WHIT">        </span><span class="NAME">_getAllOptionsAfterFiltered</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>932</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dropList</span><span class="PUNC">=</span><span class="NAME">this.dropList</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>933</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">dropList.find</span><span class="PUNC">(</span><span class="STRN">'.om-combo-list-row'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">not</span><span class="PUNC">(</span><span class="NAME">dropList.find</span><span class="PUNC">(</span><span class="STRN">'.om-helper-hidden'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>934</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>935</span> </span><span class="WHIT">        </span><span class="NAME">_doFilter</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>936</span> </span><span class="WHIT">        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">inputEl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.textInput</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">valueEl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.element</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.options</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>937</span> </span><span class="WHIT">            </span><span class="NAME">records</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.dataSource</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>938</span> </span><span class="WHIT">            </span><span class="NAME">filterStrategy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">options.filterStrategy</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>939</span> </span><span class="WHIT">            </span><span class="NAME">text</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">inputEl.val</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>940</span> </span><span class="WHIT">            </span><span class="NAME">needShow</span><span class="PUNC">=</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>941</span> </span><span class="WHIT">            </span><span class="NAME">items</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self._getAllOptionsBeforeFiltered</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>942</span> </span><span class="WHIT">            </span><span class="NAME">allInputText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$.data</span><span class="PUNC">(</span><span class="NAME">valueEl</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'allInputText'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>943</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='line'>944</span> </span><span class="WHIT">            </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">records</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>945</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self._filetrPass</span><span class="PUNC">(</span><span class="NAME">filterStrategy</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">records</span><span class="PUNC">[</span><span class="NAME">index</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">allInputText</span><span class="PUNC">[</span><span class="NAME">index</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>946</span> </span><span class="WHIT">                    </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">items.get</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">'om-helper-hidden'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>947</span> </span><span class="WHIT">                    </span><span class="NAME">needShow</span><span class="PUNC">=</span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>948</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>949</span> </span><span class="WHIT">                    </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">items.get</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'om-helper-hidden'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>950</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>951</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>952</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dropList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.dropList.css</span><span class="PUNC">(</span><span class="STRN">'height'</span><span class="PUNC">,</span><span class="STRN">'auto'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>953</span> </span><span class="WHIT">            </span><span class="COMM">//过滤后重新计算下拉框的高度，看是否需要出现滚动条</span><span class="WHIT">
<span class='line'>954</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.listMaxHeight</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'auto'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">dropList.height</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">options.listMaxHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>955</span> </span><span class="WHIT">                </span><span class="NAME">dropList.height</span><span class="PUNC">(</span><span class="NAME">options.listMaxHeight</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">css</span><span class="PUNC">(</span><span class="STRN">'overflow-y'</span><span class="PUNC">,</span><span class="STRN">'auto'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>956</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>957</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">needShow</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>958</span> </span><span class="WHIT">                </span><span class="NAME">dropList.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>959</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>960</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>961</span> </span><span class="WHIT">        </span><span class="NAME">_filetrPass</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">filterStrategy</span><span class="PUNC">,</span><span class="NAME">text</span><span class="PUNC">,</span><span class="NAME">record</span><span class="PUNC">,</span><span class="NAME">inputText</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>962</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">text</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>963</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>964</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>965</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">filterStrategy</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>966</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">filterStrategy</span><span class="PUNC">(</span><span class="NAME">text</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">record</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>967</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>968</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">filterStrategy</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'first'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>969</span> </span><span class="WHIT">                    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">inputText.indexOf</span><span class="PUNC">(</span><span class="NAME">text</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>970</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">filterStrategy</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'anywhere'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>971</span> </span><span class="WHIT">                    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">inputText.indexOf</span><span class="PUNC">(</span><span class="NAME">text</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>972</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">filterStrategy</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'last'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>973</span> </span><span class="WHIT">                    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">inputText.lastIndexOf</span><span class="PUNC">(</span><span class="NAME">text</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>974</span> </span><span class="WHIT">                    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">text.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">inputText.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>975</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>976</span> </span><span class="WHIT">                    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>977</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>978</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>979</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>980</span> </span><span class="WHIT">        </span><span class="NAME">_refeshEmptyText</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">emptyText</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>981</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">inputEl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.textInput</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>982</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">emptyText</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>983</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>984</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">inputEl.val</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>985</span> </span><span class="WHIT">                </span><span class="NAME">inputEl.val</span><span class="PUNC">(</span><span class="NAME">emptyText</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">'om-empty-text'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>986</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>987</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">inputEl.val</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">emptyText</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>988</span> </span><span class="WHIT">                    </span><span class="NAME">inputEl.val</span><span class="PUNC">(</span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>989</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>990</span> </span><span class="WHIT">                </span><span class="NAME">inputEl.removeClass</span><span class="PUNC">(</span><span class="STRN">'om-empty-text'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>991</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>992</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>993</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>994</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">jQuery</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>